package pers.cz.orm.db;

import org.junit.Test;
import pers.cz.orm.dao.CommonDbDaoImpl;
import pers.cz.common.pub.Operator;
import pers.cz.orm.entity.ImsJsonSoap10;

import java.util.Date;

/**
 * @program: Jef-orm
 * @description: 测试删除操作
 * @author: Cheng Zhi
 * @create: 2023-09-02 16:25
 **/
public class Delete {

    /**
     * @author Chengzhi
     * @date 2023-09-02
     * @测试目的：
     * @预期结果: delete  from AID2.IMS_JSON_SOAP_1_0 where BUSI_CODE = 8888 and SO_DATE > TO_DATE('2023-09-02 16:27:54','yyyy-mm-dd hh24:mi:ss')
     */
    @Test
    public void testSingleDelete(){
        ImsJsonSoap10 imsJsonSoap10 = new ImsJsonSoap10();
        imsJsonSoap10.getQuery().addCondition(ImsJsonSoap10.Field.busiCode, 8888);
        imsJsonSoap10.getQuery().addCondition(ImsJsonSoap10.Field.soDate, Operator.GREAT, new Date());
        int delete = new CommonDbDaoImpl().delete(imsJsonSoap10);
        System.out.println(delete);
    }
}
